Summary of the Movie Toolbox
C Summary
Constants
#define kFix1= (0x00010000); /* fixed point value equal to 1.0 */ #define gestaltQuickTime 'qtim' /* Movie Toolbox availability */ #define MovieFileType 'MooV' /* movie file type */ #define VideoMediaType 'vide' /* video media type */ #define SoundMediaType 'soun' /* sound media type */ #define MediaHandlerType 'mhlr' /* media handler type */ #define DataHandlerType 'dhlr' /* data handler type */ #define TextMediaType 'text' /* text media type */ #define GenericMediaType 'gnrc' /* base media handler type */ #define DoTheRightThing = 0L /* indicates default flag settings for Movie Toolbox functions */ /* sound volume values in trackVolume parameter of NewMovieTrack function */ #define kFullVolume = 0x100 /* full, natural volume (8.8 format) */ #define kNoVolume = 0 /* no volume */ /* constants for whichMediaTypes parameter of GetMovieNextInterestingTime function */ #define VisualMediaCharacteristic 'eyes'/* visual media */ #define AudioMediaCharacteristic 'ears' /* audio media */ enum { /* media quality settings in quality parameter of SetMediaQuality function */ mediaQualityDraft = 0x0000, /* lowest quality level */ mediaQualityNormal = 0x0040, /* acceptable quality level */ mediaQualityBetter = 0x0080, /* better quality level */ mediaQualityBest = 0x00C0 /* best quality level */ }; enum { /* values for callBackFlags field of QuickTime callback header structure used by clock components to communicate scheduling information about a callback event to the Movie Toolbox */ qtcbNeedsRateChanges = 1, /* rate changes */ qtcbNeedsTimeChanges = 2, /* time changes */ qtcbNeedsStartStopChanges = 4 /* time base changes at start & stop times */ }; enum { /* dialog items to include in dialog box definition for use with SFPGetFilePreview function */ sfpItemPreviewAreaUser = 11, /* user preview area */ sfpItemPreviewStaticText = 12, /* static text preview */ sfpItemPreviewDividerUser = 13, /* user divider preview */ sfpItemCreatePreviewButton = 14, /* create preview button */ sfpItemShowPreviewButton = 15 /* show preview button */ }; enum { movieInDataForkResID = -1 /* magic resource ID */ }; enum { /* flags for LoadIntoRAM functions */ keepInRam = 1<<0, /* load and make so data cannot be purged */ unkeepInRam = 1<<1, /* mark data so it can be purged */ flushFromRam = 1<<2, /* empty handles and purge data from memory */ loadForwardTrackEdits = 1<<3, /* load only data around track edits--play movie forward */ loadBackwardTrackEdits = 1<<4 /* load only data around edits-- play movie in reverse */ }; enum { /* flag for PasteHandleIntoMovie function */ pasteInParallel = 1 /* changes function to take contents and type of handle and add to movie */ }; /* text description display flags used in AddTextSample and AddTESample */ enum { dfDontDisplay = 1<<0, /* don't display the text */ dfDontAutoScale = 1<<1, /* don't scale text as track bounds grows or shrinks */ dfClipToTextBox = 1<<2, /* clip update to the text box */ dfUseMovieBGColor = 1<<3, /* set text background to movie's background color */ dfShrinkTextBoxToFit = 1<<4, /* compute minimum box to fit the sample */ dfScrollIn = 1<<5, /* scroll text in until last of text is in view */ dfScrollOut = 1<<6 /* scroll text out until last of text is gone (if dfScrollIn is also set, scroll in then out */ dfHorizScroll = 1<<7, /* scroll text horizontally--otherwise, it's vertical */ dfReverseScroll = 1<<8 /* vertically scroll down and horizontally scroll up--justification-dependent */ }; /* find flags for FindNextText function */ findTextEdgeOK = 1<<0, /* OK to find text at specified sample time */ findTextCaseSensitive = 1<<1, /* case-sensitive search */ findTextReverseSearch = 1<<2, /* search from sampleTime backward */ findTextWraparound = 1<<3, /* wrap search when beginning or end of movie is reached */ /* return display flags for application-defined text function */ enum { txtProcDefaultDisplay = 0, /* use the media's default settings */ txtProcDontDisplay = 1, /* don't display the text */ txtProcDoDisplay = 2 /* display the text */ }; enum { hintsScrubMode = 1<<0, /* toolbox can display key frames when movie is repositioned */ hintsAllowInterlace = 1<<6, /* use interlace option for compressor components */ hintsUseSoundInterp = 1<<7 /* turn on sound interpolation */ }; typedef unsigned long playHintsEnum;Data Types
typedef MovieRecord *Movie; /* movie identifier */ typedef TrackRecord *Track; /* track identifer */ typedef MediaRecord *Media; /* media identifier */ typedef UserDataRecord *UserData; /* user data list identifier */ typedef TrackEditStateRecord *TrackEditState; /* track edit state identifier */ typedef MovieEditStateRecord *MovieEditState; /* movie edit state identifier */ typedef long TimeValue; /* time value field in time structure */ typedef long TimeScale; /* time scale field in time structure */ typedef TimeBaseRecord *TimeBase; /* time base identifier */ typedef CallBackRecord *QTCallBack; /* callback identifier */ typedef Int64 CompTimeValue; struct Int64 { long hi; /* high-order 32 bits of value field in time structure */ long lo; /* low-order 32 bits of value field in time structure */ }; typedef struct Int64 Int64; struct TimeRecord { CompTimeValue value;/* time value as duration or absolute */ TimeScale scale;/* time scale as unit of time & number of units */ TimeBase base; /* reference to the time base */ }; typedef struct TimeRecord TimeRecord; /* All sample descriptions start with this header. */ struct SampleDescription { long descSize; /* total size in bytes of this structure */ long dataFormat; /* format of the sample data */ long resvd1; /* reserved--set to 0 */ short resvd2; /* reserved--set to 0 */ short dataRefIndex; /* reserved--set to 1 */ }; typedef struct SampleDescription SampleDescription; typedef SampleDescription *SampleDescriptionPtr, **SampleDescriptionHandle; struct SoundDescription { long descSize; /* total size in bytes of this structure */ long dataFormat; /* format of the sound data */ long resvd1; /* reserved--set to 0 */ short resvd2; /* reserved--set to 0 */ short dataRefIndex; /* reserved--set to 1 */ short version; /* which version is this data? */ short revlevel; /* which version of that codec did this? */ long vendor; /* which codec compressed this data? */ short numChannels;/* number of sound channels used by sample */ short sampleSize; /* number of bits in each sound sample */ short compressionID; /* sound compression used--set to 0 if none */ short packetSize; /* packet size for compression--set to 0 if no compression */ Fixed sampleRate; /* rate at which sound samples were obtained */ }; typedef struct SoundDescription SoundDescription; typedef SoundDescription *SoundDescriptionPtr, **SoundDescriptionHandle; typedef struct TextDescription { long size; /* total size of this text description structure */ long type; /* type of data in this structure ('text') */ long resvd1; /* reserved for use by Apple--set to 0 */ short resvd2; /* reserved for use by Apple--set to 0 */ short dataRefIndex; /* index to data references */ long displayFlags; /* display flags for text */ long textJustification; /* text justification flags */ RGBColor bgColor; /* background color */ Rect defaultTextBox;/* location of the text within track bounds */ ScrpSTElement defaultStyle; /* default style (TextEdit structure) */ } TextDescription, *TextDescriptionPtr, **TextDescriptionHandle; typedef struct TextDescription TextDescription; typedef TextDescription *TextDescriptionPtr, **TextDescriptionHandle; /* pointer to application-defined movie progress function */ typedef pascal OSErr (*MovieProgressProcPtr) (Movie theMovie, short message, short whatOperation, Fixed percentDone, long refcon); /* pointer to application-defined cover function */ typedef pascal OSErr (*MovieRgnCoverProc)(Movie theMovie, RgnHandle changedRgn, long refcon); typedef Handle MediaInformationHandle; /* data returned by media handler */ typedef ComponentInstance MediaHandler; /* media handler */ typedef Component MediaHandlerComponent; /* media handler component */ typedef ComponentInstance DataHandler; /* data handler */ typedef Component DataHandlerComponent; /* data handler component */ typedef ComponentResult HandlerError; /* error handler */ typedef ComponentInstance MovieController; /* movie controller */ /* pointer to application-defined error-notification function */ typedef pascal void (*ErrorProcPtr)(OSErr theErr, long refcon); /* pointer to application-defined movie preview callout function */ typedef pascal Boolean (*MoviePreviewCallOutProc)(long refcon); enum { /* control flags for timeBaseFlags parameter of SetTimeBaseFlags function */ loopTimeBase = 1, /* whether time base loops */ palindromeLoopTimeBase = 2 /* whether time base loops in palindrome fashion */ }; typedef unsigned long TimeBaseFlags; /* control flags for time base */ /* pointer to application-defined callback function */ typedef pascal void (*QTCallBackProc)(QTCallBack cb, long refcon); struct QTCallBackHeader { long callBackFlags; /* clock component scheduling data flags */ long reserved1; /* reserved for use by Apple */ char qtPrivate[40]; /* reserved for use by Apple */ }; struct MatrixRecord { Fixed matrix[3][3]; }; typedef struct FixedPoint FixedPoint; struct FixedPoint { Fixed x; /* point's x coordinate as fixed-point number */ Fixed y; /* point's y coordinate as fixed-pont number */ }; typedef struct MatrixRecord MatrixRecord; typedef MatrixRecord *MatrixRecordPtr;/* pointer to matrix structure */ struct FixedRect { Fixed left; /* x coordinate of rectangle's upper-left corner */ Fixed top; /* y coordinate of rectangle's upper-left corner */ Fixed right; /* x coordinate of rectangle's lower-right corner */ Fixed bottom; /* y coordinate of rectangle's lower-right corner */ }; typedef struct FixedRect FixedRect; enum { /* progress function messages */ movieProgressOpen = 0, /* indicates start of a long operation */ movieProgressUpdatePercent = 1, /* passes completion data to function */ movieProgressClose = 2 /* indicates end of a long operation */ }; typedef unsigned char movieProgressMessages; enum { /* progress function operations that tell which function your application has called */ progressOpFlatten = 1, /* FlattenMovie or FlattenMovieData */ progressOpInsertTrackSegment = 2, /* InsertTrackSegment */ progressOpInsertMovieSegment = 3, /* InsertMovieSegment */ progressOpPaste = 4, /* PasteMovieSelection */ progressOpAddMovieSelection = 5, /* AddMovieSelection */ progressOpCopy = 6, /* CopyMovieSelection */ progressOpCut = 7, /* CutMovieSelection */ progressOpLoadMovieIntoRam = 8, /* LoadMovieIntoRam */ progressOpLoadTrackIntoRam = 9, /* LoadTrackIntoRam */ progressOpLoadMediaIntoRam = 10, /* LoadMediaIntoRam */ progressOpImportMovie = 11, /* ConvertFileToMovieFile */ progressOpExportMOvie = 12 /* ConvertMovieFile */ }; typedef unsigned char movieProgressOperations; enum { /* NewMovie function flags */ newMovieActive = 1<<0, /* new movie is or is not active */ newMovieDontResolveDataRefs = 1<<1, /* data reference resolution level */ newMovieDontAskUnresolvedDataRefs = 1<<2, /* is user asked to locate files? */ newMovieDontAutoAlternates = 1<<3 /* are enabled tracks selected from alternate groups? */ }; typedef unsigned char newMovieFlagsEnum; /* track usage flags in SetTrackUsage function */ enum { trackUsageInMovie = 1<<1, /* track is used in movie */ trackUsageInPreview = 1<<2, /* track is used in preview */ trackUsageInPoster = 1<<3 /* track is used in poster */ }; typedef unsigned char trackUsageEnum; /* media sample flags in AddMediaSample function */ enum { mediaSampleNotSync = 1<<0, /* sample to be added is not a sync sample */ mediaSampleShadowSync = 1<<1 /* sample is a shadow sync sample */ }; typedef unsigned char mediaSampleFlagsEnum; enum { /* interesting times flags in interestingTimeFlags parameter of GetMovieNextInterestingTime function */ nextTimeMediaSample = 1<<0, /* finds next sample in movie's media */ nextTimeMediaEdit = 1<<1, /* finds next sample group in movie's media */ nextTimeTrackEdit = 1<<2, /* finds sample for next entry in edit list */ nextTimeSyncSample = 1<<3, /* finds next sync sample in movie's media */ nextTimeEdgeOK = 1<<14, /* to receive element data at specified time */ nextTimeIgnoreActiveSegment = 1<<15 /* look outside active segment for samples */ }; typedef unsigned short nextTimeFlagsEnum; enum { /* movie-creation flags from CreateMovieFile function */ createMovieFileDeleteCurFile = 1L<<31, /* delete existing file? */ createMovieFileDontCreateMovie = 1L<<30, /* is new movie created? */ createMovieFileDontOpenFile = 1L<<29 /* is new movie file opened? */ }; typedef unsigned long createMovieFileFlagsEnum; /* movie-flattening flags from FlattenFlags function */ enum { flattenAddMovieToDataFork = 1L<<0,/* movie placed in data fork */ flattenActiveTracksOnly = 1L<<2,/* enabled movie tracks added */ flattenDontInterleaveFlatten = 1L<<3 /* disable data storage optimizations */ }; typedef unsigned long movieFlattenFlagsEnum; enum { /* movie scrap flags from PutMovieOnScrap function */ movieScrapDontZeroScrap= 1<<0,/* is scrap cleared before movie is put on scrap? */ movieScrapOnlyPutMovie = 1<<1 /* are other items placed on scrap along with movie? */ }; typedef unsigned char movieScrapFlagsEnum; enum { /* callback flags from CallMeWhen function specify when callback should be called */ triggerTimeFwd = 0x0001, /* only when time is at positive rate */ triggerTimeBwd = 0x0002, /* only when time is at negative rate */ triggerTimeEither = 0x0003, /* at specified time without regard to rate */ triggerRateLT = 0x0004, /* whenever rate changes */ triggerRateGT = 0x0008, /* when changed rate greater than param2 */ triggerRateEqual = 0x0010, /* when changed rate equal to param2 */ triggerRateLTE = triggerRateLT | triggerRateEqual, /* when rate less than or equal to param2 */ triggerRateGTE = triggerRateGT | triggerRateEqual, /* when rate greater than or equal to param2 */ triggerRateNotEqual = triggerRateGT | triggerRateEqual | triggerRateLT, /* when rate is not equal to param2 */ triggerRateChange = 0 /* whenever rate changes */ triggerAtStart = 0x0001, /* at startup time */ triggerAtStop = 0x0002 /* at stop time */ }; typedef unsigned short QTCallBackFlags; enum { /* flags returned by GetTimeBaseStatus function specify where time value in time structure lies */ timeBaseBeforeStartTime = 1, /* before start time of time base */ timeBaseAfterStopTime = 2 /* after stop time of time base */ }; typedef unsigned long TimeBaseStatus; enum { /* values for cbType parameter of NewCallBack function specify when event can be invoked */ callBackAtTime = 1, /* at a specified time */ callBackAtRate = 2, /* time base rate at specified value */ callBackAtTimeJump = 3, /* time value jumps unexpectedly */ callBackAtExtremes = 4 /* time value at start time, stop time, or either */ callBackAtInterrupt = 0x8000 /* at interrupt time */ }; typedef unsigned short QTCallBackType; enum { identityMatrixType = 0x00, /* identity matrix */ translateMatrixType = 0x01, /* translation operation */ scaleTranslateMatrixType = 0x03, /* translation & scaling operation */ linearMatrixType = 0x04, /* rotation, skew, or shear operation */ linearTranslateMatrixType = 0x05, /* translation & rotation, skew, or shear operation */ perspectiveMatrixType = 0x06 /* perspective (nonlinear) operation */ }; typedef unsigned short MatrixFlags; enum { /* values for the dataRefAttributes parameter of the GetMediaDataRef function */ dataRefSelfReference = 1<<0,/* is reference to movie resource's data file? */ dataRefWasNotResolved = 1<<1/* did Movie Toolbox resolve reference? */ }; typedef unsigned long dataRefAttributesFlags; enum { /* flags for SetMoviePlayHints and SetMediaPlayHints functions */ hintsScrubMode = 1<<0, /* mask == && (if flags == scrub on, flags != scrub off) */ hintsAllowInterlace = 1<<6, hintsUseSoundInterp = 1<<7 } ; typedef unsigned long playHintsEnum; enum { mediaHandlerFlagGenericClient = 1 /* component flag--should be set for all media handler components that make use of generic media handler */ }; typedef unsigned long mediaHandlerFlagsEnum;Functions for Getting and Playing Movies
Initializing the Movie Toolbox
pascal OSErr EnterMovies (void); pascal void ExitMovies (void);Error Functions
pascal OSErr GetMoviesError (void); pascal OSErr GetMoviesStickyError (void); pascal void ClearMoviesStickyError (void); pascal void SetMoviesErrorProc (ErrorProcPtr errProc, long refcon);Movie Functions
pascal OSErr NewMovieFromFile (Movie *theMovie, short resRefNum, short *resId, StringPtr resName, short newMovieFlags, Boolean *dataRefWasChanged); pascal OSErr NewMovieFromHandle (Movie *theMovie, Handle h, short newMovieFlags, Boolean *dataRefWasChanged); pascal Movie NewMovie (long newMovieFlags); pascal OSErr ConvertFileToMovieFile (const FSSpec *inputFile, const FSSpec *outputFile, OSType creator, ScriptCode scriptTag, short *resID, long flags, ComponentInstance userComp, MovieProgressProcPtr proc, long refcon); pascal OSErr ConvertMovieToFile (Movie theMovie, Track onlyTrack, const FSSpec *outputFile, OSType fileType, OSType creator, ScriptCode scriptTag, short *resID, long flags, ComponentInstance userComp); pascal void DisposeMovie(Movie theMovie); pascal OSErr CreateMovieFile (const FSSpec *fileSpec, OSType creator, ScriptCode scriptTag, long createMovieFileFlags, short *resRefNum, Movie *newMovie); pascal OSErr OpenMovieFile(const FSSpec *fileSpec, short *resRefNum, char perms); pascal OSErr CloseMovieFile (short resRefNum); pascal OSErr DeleteMovieFile (const FSSpec *fileSpec);Saving Movies
pascal Boolean HasMovieChanged (Movie theMovie); pascal void ClearMovieChanged (Movie theMovie); pascal OSErr AddMovieResource (Movie theMovie, short resRefNum, short *resId, const StringPtr resName); pascal OSErr UpdateMovieResource (Movie theMovie, short resRefNum, short resId, const StringPtr resName); pascal OSErr RemoveMovieResource (short resRefNum, short resId); pascal OSErr PutMovieIntoHandle (Movie theMovie, HandlepublicMovie
); pascal void FlattenMovie (Movie theMovie, long movieFlattenFlags, const FSSpec *theFile, OSType creator, ScriptCode scriptTag, long createMovieFileFlags, short *resId, const StringPtr resName); pascal Movie FlattenMovieData (Movie theMovie, long movieFlattenFlags, const FSSpec *theFile, OSType creator, ScriptCode scriptTag, long createMovieFileFlags); pascal OSErr NewMovieFromDataFork (Movie *theMovie, short fRefNum, long fileOffset, short newMovieFlags, Boolean *dataRefWasChanged); pascal OSErr PutMovieIntoDataFork (Movie theMovie, short fRefNum, long offset, long maxSize);Controlling Movie Playback
pascal void StartMovie (Movie theMovie); pascal void StopMovie (Movie theMovie); pascal void GoToBeginningOfMovie (Movie theMovie); pascal void GoToEndOfMovie (Movie theMovie);Movie Posters and Movie Previews
pascal void SetTrackUsage (Track theTrack, long usage); pascal long GetTrackUsage (Track theTrack); pascal void ShowMoviePoster (Movie theMovie); pascal void SetPosterBox (Movie theMovie, const Rect *boxRect); pascal void GetPosterBox (Movie theMovie, Rect *boxRect); pascal void SetMoviePosterTime (Movie theMovie, TimeValue posterTime); pascal TimeValue GetMoviePosterTime (Movie theMovie); pascal void PlayMoviePreview (Movie theMovie, MoviePreviewCallOutProc callOutProc, long refcon); pascal void SetMoviePreviewMode (Movie theMovie, Boolean usePreview); pascal Boolean GetMoviePreviewMode (Movie theMovie); pascal void SetMoviePreviewTime (Movie theMovie, TimeValue previewTime, TimeValue previewDuration); pascal void GetMoviePreviewTime (Movie theMovie, TimeValue *previewTime, TimeValue *previewDuration);Movies and Your Event Loop
pascal void MoviesTask (Movie theMovie, long maxMilliSecToUse); pascal Boolean IsMovieDone (Movie theMovie); pascal OSErr UpdateMovie (Movie theMovie); pascal Boolean PtInMovie (Movie theMovie, Point pt); pascal Boolean PtInTrack (Track theTrack, Point pt); pascal ComponentResult GetMovieStatus (Movie theMovie, Track *firstProblemTrack); pascal ComponentResult GetTrackStatus (Track theTrack);Preferred Movie Settings
pascal void SetMoviePreferredRate (Movie theMovie, Fixed rate); pascal Fixed GetMoviePreferredRate (Movie theMovie); pascal void SetMoviePreferredVolume (Movie theMovie, short volume); pascal short GetMoviePreferredVolume (Movie theMovie);Enhancing Movie Playback Performance
pascal OSErr PrerollMovie (Movie theMovie, TimeValue time, Fixed Rate); pascal void SetMovieActiveSegment (Movie theMovie, TimeValue startTime, TimeValue duration); pascal void GetMovieActiveSegment (Movie theMovie, TimeValue *startTime, TimeValue *duration); pascal void SetMoviePlayHints (Movie theMovie, long flags, long flagsMask); pascal void SetMediaPlayHints (Media theMedia, long flags, long flagsMask); pascal OSErr LoadMovieIntoRam (Movie theMovie, TimeValue time, TimeValue duration, long flags); pascal OSErr LoadTrackIntoRam (Track theTrack, TimeValue time, TimeValue duration, long flags); pascal OSErr LoadMediaIntoRam (Media theMedia, TimeValue time, TimeValue duration, long flags); pascal OSErr SetMediaShadowSync (Media theMedia, long frameDiffSampleNum long syncSampleNum); pascal OSErr GetMediaShadowSync (Media theMedia, long frameDiffSampleNum long *syncSampleNum);Disabling Movies and Tracks
pascal void SetMovieActive (Movie theMovie, Boolean active); pascal Boolean GetMovieActive (Movie theMovie); pascal void SetTrackEnabled (Track theTrack, Boolean isEnabled); pascal Boolean GetTrackEnabled (Track theTrack);Generating Pictures From Movies
pascal PicHandle GetMoviePict (Movie theMovie, TimeValue time); pascal PicHandle GetMoviePosterPict (Movie theMovie); pascal PicHandle GetTrackPict (Track theTrack, TimeValue time);Creating Tracks and Media Structures
pascal Track NewMovieTrack (Movie theMovie, Fixed width, Fixed height, short trackVolume); pascal void DisposeMovieTrack (Track theTrack); pascal Media NewTrackMedia (Track theTrack, OSType mediaType, TimeScale timeScale, Handle dataRef, OSType dataRefType); pascal void DisposeTrackMedia (Media theMedia);Working With Progress and Cover Functions
pascal void SetMovieProgressProc (Movie theMovie, MovieProgressProcPtr p, long refcon); pascal void SetMovieCoverProcs (Movie theMovie, MovieRgnCoverProc uncoverProc, MovieRgnCoverProc coverProc, long refcon);Functions That Modify Movie Properties
Working With Movie Spatial Characteristics
pascal void SetMovieGWorld (Movie theMovie, CGrafPtr port, GDHandle gdh); pascal void GetMovieGWorld (Movie theMovie, CGrafPtr *port, GDHandle *gdh); pascal void SetMovieBox (Movie theMovie, const Rect *boxRect); pascal void GetMovieBox (Movie theMovie, Rect *boxRect); pascal RgnHandle GetMovieDisplayBoundsRgn (Movie theMovie); pascal RgnHandle GetMovieSegmentDisplayBoundsRgn (Movie theMovie, TimeValue time, TimeValue duration); pascal void SetMovieDisplayClipRgn (Movie theMovie, RgnHandle theClip); pascal RgnHandle GetMovieDisplayClipRgn (Movie theMovie); pascal RgnHandle GetTrackDisplayBoundsRgn (Track theTrack); pascal RgnHandle GetTrackSegmentDisplayBoundsRgn (Track theTrack, TimeValue time, TimeValue duration); pascal void SetTrackLayer (Track theTrack, short layer); pascal short GetTrackLayer (Track theTrack); pascal void SetMovieMatrix (Movie theMovie, const MatrixRecord *matrix); pascal void GetMovieMatrix (Movie theMovie, MatrixRecord *matrix); pascal RgnHandle GetMovieBoundsRgn (Movie theMovie); pascal RgnHandle GetTrackMovieBoundsRgn (Track theTrack); pascal void SetMovieClipRgn (Movie theMovie, RgnHandle theClip); pascal RgnHandle GetMovieClipRgn (Movie theMovie); pascal void SetTrackMatrix (Track theTrack, const MatrixRecord *matrix); pascal void GetTrackMatrix (Track theTrack, MatrixRecord *matrix); pascal RgnHandle GetTrackBoundsRgn (Track theTrack); pascal void SetTrackDimensions (Track theTrack, Fixed width, Fixed height); pascal void GetTrackDimensions (Track theTrack, Fixed *width, Fixed *height); pascal void SetTrackClipRgn (Track theTrack, RgnHandle theClip); pascal RgnHandle GetTrackClipRgn (Track theTrack); pascal void SetTrackMatte (Track theTrack, PixMapHandle theMatte); pascal PixMapHandle GetTrackMatte (Track theTrack); pascal void DisposeMatte (PixMapHandle theMatte);Working With Sound Volume
pascal void SetMovieVolume (Movie theMovie, short volume); pascal short GetMovieVolume (Movie theMovie); pascal void SetTrackVolume (Track theTrack, short volume); pascal short GetTrackVolume (Track theTrack);Working With Movie Time
pascal TimeValue GetMovieDuration (Movie theMovie); pascal void SetMovieTimeValue (Movie theMovie, TimeValue newtime); pascal void SetMovieTime (Movie theMovie, const TimeRecord *newtime); pascal TimeValue GetMovieTime (Movie theMovie, TimeRecord *currentTime); pascal void SetMovieRate (Movie theMovie, Fixed rate); pascal Fixed GetMovieRate (Movie theMovie); pascal void SetMovieTimeScale (Movie theMovie, TimeScale timeScale); pascal TimeScale GetMovieTimeScale (Movie theMovie); pascal TimeBase GetMovieTimeBase (Movie theMovie);Working With Track Time
pascal TimeValue GetTrackDuration (Track theTrack); pascal void SetTrackOffset (Track theTrack, TimeValue movieOffsetTime); pascal TimeValue GetTrackOffset (Track theTrack); pascal TimeValue TrackTimeToMediaTime (TimeValue value, Track theTrack);Working With Media Time
pascal TimeValue GetMediaDuration (Media theMedia); pascal void SetMediaTimeScale (Media theMedia, TimeScale timeScale); pascal TimeScale GetMediaTimeScale (Media theMedia);Finding Interesting Times
pascal void GetMovieNextInterestingTime (Movie theMovie, short interestingTimeFlags, short numMediaTypes, const OSType *whichMediaTypes, TimeValue time, Fixed rate, TimeValue *interestingTime, TimeValue *interestingDuration); pascal void GetTrackNextInterestingTime (Track theTrack, short interestingTimeFlags, TimeValue time, Fixed rate, TimeValue *interestingTime, TimeValue *interestingDuration); pascal void GetMediaNextInterestingTime (Media theMedia, short interestingTimeFlags, TimeValue time, Fixed rate, TimeValue *interestingTime, TimeValue *interestingDuration);Locating a Movie's Tracks and Media Structures
pascal long GetMovieTrackCount (Movie theMovie); pascal Track GetMovieIndTrack (Movie theMovie, long index); pascal Track GetMovieTrack (Movie theMovie, long trackID); pascal long GetTrackID (Track theTrack); pascal Movie GetTrackMovie (Track theTrack); pascal Media GetTrackMedia (Track theTrack); pascal Track GetMediaTrack (Media theMedia);Working With Alternate Tracks
pascal void SetMovieLanguage (Movie theMovie, long language); pascal void SelectMovieAlternates (Movie theMovie); pascal void SetAutoTrackAlternatesEnabled (Movie theMovie, Boolean enable); pascal void SetTrackAlternate (Track theTrack, Track alternateT); pascal Track GetTrackAlternate (Track theTrack); pascal void SetMediaLanguage (Media theMedia, short language); pascal short GetMediaLanguage (Media theMedia); pascal void SetMediaQuality (Media theMedia, short quality); pascal short GetMediaQuality (Media theMedia);Working With Data References
pascal OSErr AddMediaDataRef (Media theMedia, short *index, Handle dataRef, OSType dataRefType); pascal OSErr SetMediaDataRef (Media theMedia, short index, Handle dataRef, OSType dataRefType); pascal OSErr GetMediaDataRefCount (Media theMedia, short *count); pascal OSErr GetMediaDataRef (Media theMedia, short index, Handle *dataRef, OSType *dataRefType, long *dataRefAttributes);Determining Movie Creation and Modification Time
pascal unsigned long GetMovieCreationTime (Movie theMovie); pascal unsigned long GetMovieModificationTime (Movie theMovie); pascal unsigned long GetTrackCreationTime (Track theTrack); pascal unsigned long GetTrackModificationTime (Track theTrack); pascal unsigned long GetMediaCreationTime (Media theMedia); pascal unsigned long GetMediaModificationTime (Media theMedia);Working With Media Samples
pascal long GetMovieDataSize (Movie theMovie, TimeValue startTime, TimeValue duration); pascal long GetTrackDataSize (Track theTrack, TimeValue startTime, TimeValue duration); pascal long GetMediaDataSize (Media theMedia, TimeValue startTime, TimeValue duration); pascal long GetMediaSampleCount (Media theMedia); pascal long GetMediaSampleDescriptionCount (Media theMedia); pascal void GetMediaSampleDescription (Media theMedia, long index, SampleDescriptionHandle descH); pascal OSErr SetMediaSampleDescription (Media theMedia, long index, SampleDescriptionHandle descH); pascal void MediaTimeToSampleNum (Media theMedia, TimeValue time, long *sampleNum, TimeValue *sampleTime, TimeValue *sampleDuration); pascal void SampleNumToMediaTime (Media theMedia, long logicalSampleNum, TimeValue *sampleTime, TimeValue *sampleDuration);Working With Movie User Data
pascal UserData GetMovieUserData (Movie theMovie); pascal UserData GetTrackUserData (Track theTrack); pascal UserData GetMediaUserData (Media theMedia); pascal long GetNextUserDataType (UserData theUserData, OSType udType); pascal short CountUserDataType (UserDatatheUserData
, OSType udType); pascal OSErr AddUserData (UserData theUserData, Handle data, OSType udType); pascal OSErr GetUserData (UserData theUserData, Handle data, OSType udType,long index); pascal OSErr RemoveUserData (UserDatatheUserData
, OSType udType, long index); pascal OSErr AddUserDataText (UserDatatheUserData
, Handle data, OSType udType, long index, short itlRegionTag); pascal OSErr GetUserDataText (UserDatatheUserData
, Handle data, OSType udType, long index, short itlRegionTag); pascal OSErr RemoveUserDataText (UserDatatheUserData
, OSType udType, long index, short itlRegionTag); pascal OSErr SetUserDataItem (UserData theUserData, void *data, long size, OSType udType, long index); pascal OSErr GetUserDataItem (UserData theUserData, void *data, long size, OSType udType, long index); pascal OSErr NewUserData (UserData *theUserData); pascal OSErr DisposeUserData (UserData theUserData); pascal OSErr PutUserDataIntoHandle (UserData theUserData, Handle h); pascal OSErr NewUserDataFromHandle (Handle h, UserData *theUserData);Functions for Editing Movies
Editing Movies
pascal OSErr PutMovieOnScrap (Movie theMovie, long movieScrapFlags); pascal Movie NewMovieFromScrap (long newMovieFlags); pascal void SetMovieSelection (Movie theMovie, TimeValue selectionTime, TimeValue selectionDuration); pascal void GetMovieSelection (Movie theMovie, TimeValue *selectionTime, TimeValue *selectionDuration); pascal Movie CutMovieSelection (Movie theMovie); pascal Movie CopyMovieSelection (Movie theMovie); pascal void PasteMovieSelection (Movie theMovie, Movie src); pascal void AddMovieSelection (Movie theMovie, Movie src); pascal void ClearMovieSelection (Movie theMovie); pascal Component IsScrapMovie (Track targetTrack); pascal OSErr PasteHandleIntoMovie (Handle h, OSType handleType, Movie theMovie, long flags, ComponentInstance userComp); pascal OSErr PutMovieIntoTypedHandle (Movie theMovie, Track targetTrack, OSType handleType, Handle publicMovie, TimeValue start, TimeValue dur, long flags, ComponentInstance userComp);Undo for Movies
pascal MovieEditState NewMovieEditState (Movie theMovie); pascal OSErr UseMovieEditState (Movie theMovie, MovieEditState toState); pascal OSErr DisposeMovieEditState (MovieEditState state);Low-Level Movie-Editing Functions
pascal OSErr InsertMovieSegment (Movie srcMovie, Movie dstMovie, TimeValue srcIn, TimeValue srcDuration, TimeValue dstIn); pascal OSErr InsertEmptyMovieSegment (Movie dstMovie, TimeValue dstIn, TimeValue dstDuration); pascal OSErr DeleteMovieSegment (Movie theMovie, TimeValue in, TimeValue duration); pascal OSErr ScaleMovieSegment (Movie theMovie, TimeValue in, TimeValue oldDuration, TimeValue newDuration); pascal OSErr CopyMovieSettings (Movie srcMovie, Movie dstMovie);Editing Tracks
pascal OSErr InsertTrackSegment (Track srcTrack, Track dstTrack, TimeValue srcIn, TimeValue srcDuration, TimeValue dstIn); pascal OSErr InsertEmptyTrackSegment (Track dstTrack, TimeValue dstIn, TimeValue dstDuration); pascal OSErr InsertMediaIntoTrack (Track theTrack, TimeValue trackStart, TimeValue mediaTime, TimeValue mediaDuration, Fixed mediaRate); pascal OSErr DeleteTrackSegment (Track theTrack, TimeValue in, TimeValue duration); pascal OSErr ScaleTrackSegment (Track theTrack, TimeValue in, TimeValue oldDuration, TimeValue newDuration); pascal OSErr CopyTrackSettings (Track srcTrack, Track dstTrack); pascal Fixed GetTrackEditRate (Track theTrack, TimeValue atTime);Undo for Tracks
pascal TrackEditState NewTrackEditState (Track theTrack); pascal OSErr UseTrackEditState (Track theTrack, TrackEditState state); pascal OSErr DisposeTrackEditState (TrackEditState state);Adding Samples to Media Structures
pascal OSErr BeginMediaEdits (Media theMedia); pascal OSErr EndMediaEdits (Media theMedia); pascal OSErr AddMediaSample (Media theMedia, Handle dataIn, long inOffset, unsigned long size, TimeValue durationPerSample, SampleDescriptionHandle sampleDescriptionH, long numberOfSamples, short sampleFlags, TimeValue *sampleTime); pascal OSErr AddMediaSampleReference (Media theMedia, long dataOffset, unsigned long size, TimeValue durationPerSample, SampleDescriptionHandle sampleDescriptionH, long numberOfSamples, short sampleFlags, TimeValue *sampleTime); pascal OSErr GetMediaSample (Media theMedia, Handle dataOut, long maxSizeToGrow, long *size, TimeValue time, TimeValue *sampleTime, TimeValue *durationPerSample, SampleDescriptionHandle sampleDescriptionH, long *sampleDescriptionIndex, long maxNumberOfSamples, long *numberOfSamples, short *sampleFlags); pascal OSErr GetMediaSampleReference (Media theMedia, long *dataOffset, long *size, TimeValue time, TimeValue *sampleTime, TimeValue *durationPerSample, SampleDescriptionHandle sampleDescriptionH, long *sampleDescriptionIndex, long maxNumberOfSamples, long *numberOfSamples, short *sampleFlags);Media Functions
Selecting Media Handlers
pascal void GetMediaHandlerDescription (Media theMedia, OSType *mediaType, Str255 creatorName,OSType *creatorManufacturer);
pascal MediaHandler GetMediaHandler (Media theMedia); pascal OSErr SetMediaHandler (Media theMedia, MediaHandlerComponent mH); pascal void GetMediaDataHandlerDescription (Media theMedia, short index, OSType *dhType, Str255 creatorName, OSType *creatorManufacturer); pascal DataHandler GetMediaDataHandler (Media theMedia, short index); pascal OSErr SetMediaDataHandler (Media theMedia, short index, DataHandlerComponent dataHandler);Video Media Handler Functions
pascal HandlerError SetVideoMediaGraphicsMode (MediaHandler mh, long graphicsMode, const RGBColor *opColor); pascal HandlerError GetVideoMediaGraphicsMode (MediaHandler mh, long *graphicsMode, RGBColor *opColor);Sound Media Handler Functions
pascal HandlerError SetSoundMediaBalance (MediaHandler mh, short balance); pascal HandlerError GetSoundMediaBalance (MediaHandler mh, short *balance);Text Media Handler Functions
pascal ComponentResult AddTextSample (MediaHandler mh, Ptr text, unsigned long size, short fontNum, short fontSize, Style textFace, RGBColor *textColor, RGBColor *backColor, short textJustification, Rect *textBox, long displayFlags, TimeValue scrollDelay, short hiliteStart, short hiliteEnd, RGBColor rgbHiliteColor, TimeValue duration,TimeValue *sampleTime); pascal ComponentResult AddTESample (MediaHandler mh, TEHandle hTE, RGBColor *backColor,short
textJustification, Rect *textBox, long displayFlags,TimeValue scrollDelay, short
hiliteStart,short
hiliteEnd,RGBColor rgbHiliteColor,
TimeValue duration, TimeValue *sampleTime); pascal ComponentResult AddHiliteSample (MediaHandler mh,short
hiliteStart,short
hiliteEnd,RGBColor *rgbHiliteColor,
TimeValue duration, TimeValue *sampleTime); pascal ComponentResult FindNextText (MediaHandler mh, Ptr Text, long size, short findFlags,TimeValue startTime, TimeValue *foundTime, TimeValue *foundDuration, long *offset); pascal ComponentResult HiliteTextSample (MediaHandler mh, TimeValue sampleTime, short hiliteStart, short hiliteEnd,RGBColor *rgbHiliteColor
); pascal ComponentResult SetTextProc (MediaHandler mh, TextMediaProcPtr TextProc, long refcon);Functions for Creating File Previews
pascal OSErr MakeFilePreview (short resRefNum, ProgressProcRecordPtr progress); pascal OSErr AddFilePreview (short resRefNum, OSType previewType, Handle previewData);Functions for Displaying File Previews
pascal void SFGetFilePreview (Point where, ConstStr255Param prompt, FileFilterProcPtr fileFilter, short numTypes, SFTypeList typeList, DlgHookProcPtr dlgHook, SFReply *reply); pascal void SFPGetFilePreview (Point where, ConstStr255Param prompt, FileFilterProcPtr fileFilter, short numTypes, SFTypeList typeList, DlgHookProcPtr dlgHook, SFReply *reply, short dlgID, ModalFilterProcPtr filterProc); pascal void StandardGetFilePreview (FileFilterProcPtr fileFilter, short numTypes, SFTypeList typeList, StandardFileReply *reply); pascal void CustomGetFilePreview (FileFilterYDProcPtr fileFilter, short numTypes, SFTypeList typeList, StandardFileReply *reply, short dlgID, Point where, DlgHookYDProcPtr dlgHook, ModalFilterYDProcPtr filterProc, short *activeList, ActivateYDProcPtr activateProc, void *yourDataPtr);Time Base Functions
Creating and Disposing of Time Bases
pascal TimeBase NewTimeBase (void); pascal void DisposeTimeBase (TimeBase tb); pascal void SetMovieMasterClock (Movie theMovie, Component clockMeister, const TimeRecord *slaveZero); pascal void SetMovieMasterTimeBase (Movie theMovie, TimeBase tb, const TimeRecord *slaveZero); pascal void SetTimeBaseMasterClock (TimeBase slave, Component clockMeister, const TimeRecord *slaveZero); pascal ComponentInstance GetTimeBaseMasterClock (TimeBase tb); pascal void SetTimeBaseMasterTimeBase (TimeBase slave, TimeBase master, const TimeRecord *slaveZero); pascal TimeBase GetTimeBaseMasterTimeBase (TimeBase tb); pascal void SetTimeBaseZero (TimeBase tb, TimeRecord *zero);Working With Time Base Values
pascal void SetTimeBaseTime (TimeBase tb, const TimeRecord *tr); pascal void SetTimeBaseValue (TimeBase tb, TimeValue t, TimeScale s); pascal TimeValue GetTimeBaseTime (TimeBase tb, TimeScale s, TimeRecord *tr); pascal void SetTimeBaseRate (TimeBase tb, Fixed r); pascal Fixed GetTimeBaseRate (TimeBase tb); pascal Fixed GetTimeBaseEffectiveRate (TimeBase tb); pascal void SetTimeBaseStartTime (TimeBase tb, const TimeRecord *tr); pascal TimeValue GetTimeBaseStartTime (TimeBase tb, TimeScale s, TimeRecord *tr); pascal void SetTimeBaseStopTime (TimeBase tb, const TimeRecord *tr); pascal TimeValue GetTimeBaseStopTime (TimeBase tb, TimeScale s, TimeRecord *tr); pascal void SetTimeBaseFlags (TimeBase tb, long timeBaseFlags); pascal long GetTimeBaseFlags (TimeBase tb); pascal long GetTimeBaseStatus (TimeBase tb, TimeRecord *unpinnedTime);Working With Times
pascal void AddTime (TimeRecord *dst, const TimeRecord *src); pascal void SubtractTime(TimeRecord *dst, const TimeRecord *src); pascal void ConvertTime (TimeRecord *inout, TimeBase newBase); pascal void ConvertTimeScale (TimeRecord *inout, TimeScale newScale);Time Base Callback Functions
pascal QTCallBack NewCallBack (TimeBase tb, short cbType); pascal OSErr CallMeWhen (QTCallBack cb, QTCallBackProc callBackProc, long refcon, long param1, long param2, long param3); pascal void CancelCallBack (QTCallBack cb); pascal void DisposeCallBack (QTCallBack cb); pascal TimeBase GetCallBackTimeBase (QTCallBack cb); pascal short GetCallBackType (QTCallBack cb);Matrix Functions
pascal void SetIdentityMatrix (MatrixRecord *matrix); pascal short GetMatrixType (MatrixRecordPtr m); pascal void CopyMatrix (MatrixRecordPtr m1, MatrixRecord *m2); pascal Boolean EqualMatrix (const MatrixRecord *m1, const MatrixRecord *m2); pascal void TranslateMatrix (MatrixRecord *m, Fixed deltaH, Fixed deltaV); pascal void ScaleMatrix (MatrixRecord *m, Fixed scaleX, Fixed scaleY, Fixed aboutX, Fixed aboutY); pascal void RotateMatrix (MatrixRecord *m, Fixed degrees, Fixed aboutX, Fixed aboutY); pascal void SkewMatrix (MatrixRecord *m, Fixed skewX, Fixed skewY, Fixed aboutX, Fixed aboutY); pascal void ConcatMatrix (MatrixRecord *a, MatrixRecord *b); pascal Boolean InverseMatrix (MatrixRecord *m, MatrixRecord *im); pascal OSErr TransformPoints (MatrixRecord *mp, Point *pt1, long count); pascal OSErr TransformFixedPoints (MatrixRecord *m, FixedPoint *fpt, long count); pascal Boolean TransformRect (MatrixRecord *m, Rect *r, FixedPoint *fpp); pascal Boolean TransformFixedRect (MatrixRecord *m, FixedRect *fr, FixedPoint *fpp); pascal OSErr TransformRgn (MatrixRecordPtr mp, RgnHandle r); pascal void RectMatrix (MatrixRecord *matrix, Rect *srcRect, Rect *dstRect); pascal void MapMatrix (MatrixRecord *matrix, Rect *fromRect, Rect *toRect);Application-Defined Functions
Progress Functions
pascal OSErr MyProgressProc (Movie theMovie, short message, short whatOperation, Fixed percentDone, long refcon);Cover Functions
pascal OSErr MyCoverProc(Movie theMovie, RgnHandle changedRgn, long refcon);Error-Notification Functions
pascal void MyErrProc (OSErr theErr, long refcon);Movie Callout Functions
pascal Boolean MyCallOutProc (long refcon);File Filter Functions
pascal Boolean MyFileFilter (ParmBlkPtr parmBlock);Custom Dialog Functions
pascal short MyDlgHook (short item, DialogPtr theDialog, Ptr myDataPtr);Modal-Dialog Filter Functions
pascal Boolean MyModalFilter (DialogPtr theDialog, EventRecord *theEvent, short itemHit, Ptr myDataPtr);Standard File Activation Functions
pascal void MyActivateProc (DialogPtr theDialog, short itemNo, Boolean activating, Ptr myDataPtr);Callback Event Functions
pascal void MyCallBackProc (QTCallBack cb, long refcon);Text Functions
pascal OSErr MyTextProc (Handle theText, Movie theMovie, short *displayFlag, long refcon);